package com.test;

import java.io.InputStream;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.Test;

import com.po.Admin;

public class MyBetis {
	public void findAdminByIdTest() throws Exception{
		String resource = "myBatis-config.xml";
		InputStream is = Resources.getResourceAsStream(resource);
		
		SqlSessionFactory ssf = new SqlSessionFactoryBuilder().build(is);
		SqlSession ss = ssf.openSession();
		Admin a = ss.selectOne("com.po.mapper.AdminMapper.findAdminById",1);
		System.out.println(a.toString());
		ss.close();
	}
}
